package com.bt.lms.ui.page.first;

import com.bt.lms.ui.vo.PageSkipInfo;
import com.bt.lms.ui.page.sys.utils.MyHBox;
import com.bt.lms.ui.page.sys.utils.MyVBox;
import com.bt.lms.ui.page.sys.style.LabStyle;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;

/**
 * 代办事项提醒界面
 */
public class EventReminder extends VBox {

    /**
     * 界面跳转数据
     */
    private final PageSkipInfo pageSkipInfo;

    /**
     * 构建界面
     * @param pageSkipInfo 界面跳转数据
     */
    public EventReminder(PageSkipInfo pageSkipInfo){

        //维护
        this.pageSkipInfo = pageSkipInfo;

        //布局
        Insets insets = new Insets(10);
        this.setPadding(insets);
        this.setSpacing(10);

        //组件(定位区域)
        MyHBox locationHBox = new MyHBox();
        locationHBoxInit(locationHBox);
        this.getChildren().add(locationHBox);

        //组件（说明区域）
        MyVBox explainVBox = new MyVBox();
        explainVBoxInit(explainVBox);
        this.getChildren().add(explainVBox);

        //组件（记录区域）
        MyVBox recordVBox = new MyVBox();
        recordVBoxInit(recordVBox);
        this.getChildren().add(recordVBox);

    }


    /**
     * 定位区域初始化
     * @param locationHBox 定位区域
     */
    private void locationHBoxInit(MyHBox locationHBox) {

        //控制数据
        int height = 42;

        //大小
        locationHBox.setPrefHeight(height);

        //布局
        Insets insets = new Insets(5);
        locationHBox.setPadding(insets);
        locationHBox.setSpacing(0);
        locationHBox.setAlignment(Pos.CENTER_LEFT);

        //组件
        Label siteLab = new Label("当前位置：");
        LabStyle.notWeight(siteLab);//不重要（颜色浅）
        LabStyle.locationSize(siteLab);//位置样式

        Label label = new Label("🏠");
        LabStyle.notWeight(label, 0.3);
        LabStyle.locationSize(label);

        Label oneCatalogLab = new Label(">代办事项提醒");
        LabStyle.notWeight(oneCatalogLab);
        LabStyle.interaction(oneCatalogLab);
        LabStyle.locationSize(oneCatalogLab);

        //添加组件
        locationHBox.getChildren().addAll(siteLab, label, oneCatalogLab);

    }

    /**
     * 说明区域初始化
     * @param explainVBox 说明区域
     */
    private void explainVBoxInit(MyVBox explainVBox) {

        //布局
        Insets insets = new Insets(2);
        explainVBox.setPadding(insets);
        explainVBox.setSpacing(5);

        //组件（定位说明）
        Label eventReminderLab = new Label("代办事项提醒");
        explainVBox.getChildren().add(eventReminderLab);

        //组件(具体代办事项)
        HBox enpHBox = enpHBoxInit();
        ObservableList<Node> enpChildren = explainVBox.getChildren();
        enpChildren.add(enpHBox);

        HBox applyStuHBox = applyStuHBoxInit();
        ObservableList<Node> applyStuChildren = explainVBox.getChildren();
        applyStuChildren.add(applyStuHBox);

        HBox recruitStuHBox = recruitStuHBoxInit();
        ObservableList<Node> recruitStuChildren = explainVBox.getChildren();
        recruitStuChildren.add(recruitStuHBox);

        //补充数据
        explainVBox.getChildren().add(enpHBoxInit());
        //补充数据
        explainVBox.getChildren().add(applyStuHBoxInit());

        Label label = new Label("» 查看更多");
        label.setPadding(new Insets(5, 20, 5, 20));
        ObservableList<Node> children = explainVBox.getChildren();
        children.add(label);

    }

    /**
     * 记录区域初始化
     * @param recordVBox 记录区域
     */
    private void recordVBoxInit(MyVBox recordVBox) {

        //布局
        Insets insets = new Insets(2);
        recordVBox.setPadding(insets);
        recordVBox.setSpacing(5);

        //组件（定位说明）
        Label eventReminderLab = new Label("最近使用过的功能");
        recordVBox.getChildren().add(eventReminderLab);

        Insets recordIns = new Insets(5, 20, 5, 20);

        Label remindLab = new Label("代办事项提醒");
        remindLab.setPadding(recordIns);
        recordVBox.getChildren().add(remindLab);

        Label enpLab = new Label("招生管理");
        enpLab.setPadding(recordIns);
        recordVBox.getChildren().add(enpLab);

        Label separateClassLab = new Label("查看未分班招生计划");
        separateClassLab.setPadding(recordIns);
        recordVBox.getChildren().add(separateClassLab);

        Label teacherLab = new Label("教师管理");
        teacherLab.setPadding(recordIns);
        recordVBox.getChildren().add(teacherLab);

        Label coursewareLab = new Label("课件管理");
        coursewareLab.setPadding(recordIns);
        recordVBox.getChildren().add(coursewareLab);

    }

    /**
     * 代办事项 学籍
     * @return 学籍管理事项
     */
    private HBox recruitStuHBoxInit() {
        MyHBox myHBox = new MyHBox();

        //布局
        Insets insets = new Insets(5, 20, 5, 20);
        myHBox.setPadding(insets);
        myHBox.setSpacing(5);

        Label oneLab = new Label("【学籍管理】");
        myHBox.getChildren().add(oneLab);

        Label twoLab = new Label("【分班管理】");
        myHBox.getChildren().add(twoLab);

        Label threeLab = new Label(" 待分班招生计划数（3）");
        myHBox.getChildren().add(threeLab);


        return myHBox;
    }

    /**
     * 代办事项 报名学员
     * @return 报名学员事项
     */
    private HBox applyStuHBoxInit() {

        MyHBox myHBox = new MyHBox();

        //布局
        Insets insets = new Insets(5, 20, 5, 20);
        myHBox.setPadding(insets);
        myHBox.setSpacing(5);

        Label oneLab = new Label("【招生管理】");
        myHBox.getChildren().add(oneLab);

        Label twoLab = new Label("【报名学员管理】");
        myHBox.getChildren().add(twoLab);

        Label threeLab = new Label("待审核的报名学员数（33）");
        myHBox.getChildren().add(threeLab);


        return myHBox;

    }

    /**
     * 代办事项 招生
     * @return 招生事项
     */
    private HBox enpHBoxInit() {

        MyHBox myHBox = new MyHBox();

        //布局
        Insets insets = new Insets(5, 20, 5, 20);
        myHBox.setPadding(insets);
        myHBox.setSpacing(5);

        Label oneLab = new Label("【招生管理】");
        myHBox.getChildren().add(oneLab);

        Label twoLab = new Label("【招生计划管理】");
        myHBox.getChildren().add(twoLab);

        Label threeLab = new Label("待确认完成的招生计划数（3）");
        myHBox.getChildren().add(threeLab);


        return myHBox;
    }



}
